package com.ydcycloud.user.dao.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.smart.mvc.dao.hibernate.JdbcDao;
import com.ydcycloud.sys.dao.impl.BaseDaoImpl;
import com.ydcycloud.user.dao.UserDao;
import com.ydcycloud.user.model.User;

@Component("userDao")
public class UserDaoImpl extends BaseDaoImpl<User, Integer> implements UserDao {

	@Resource
	private JdbcDao baseJdbcDao;

	//用户登录
	@Override
	public User getLoginUser(String account) {
		StringBuilder sql = new StringBuilder();
		sql.append("SELECT id,name,sex,idCard,phone,area,account,educatin,wantJobId,expTime,expDetail,cardUrl,headImageUrl,PASSWORD,create_date,create_by,last_modify_date"
				+ " FROM t_user"
				+ " WHERE 1=1"
				+ " AND (account='"+account+"' OR phone='"+account+"')");
		User user = findBySqlFirst(sql.toString(), false);
		System.out.println(sql.toString());
		return user;
	}

	//获取用户信息
	@Override
	public User getUserInfo() {
		
		return null;
	}
}
